# Contributor: Dominique Martinet <dominique.martinet@atmark-techno.com>
# Maintainer: Dominique Martinet <dominique.martinet@atmark-techno.com>
pkgname=makedumpfile
pkgver=1.7.6
pkgrel=0
pkgdesc="VMcore extraction tool"
url="https://github.com/makedumpfile/makedumpfile"
arch="all !riscv64" # no kexec-tools on riscv64
license="GPL-2.0-or-later"
makedepends="musl-dev elfutils-dev bzip2-dev xz-dev lzo-dev zlib-dev zstd-dev musl-fts-dev"
depends="kexec-tools"
options="!check" # no test suite
source="$pkgname-$pkgver.tar.gz::https://github.com/makedumpfile/makedumpfile/archive/$pkgver.tar.gz
	kdump.initd
	kdump.confd"
subpackages="$pkgname-doc $pkgname-openrc"

build() {
	LINKTYPE=dynamic USELZO=on USEZSTD=on make
}

package() {
	make DESTDIR="$pkgdir" install

	install -Dm755 "$srcdir"/kdump.initd "$pkgdir"/etc/init.d/kdump
	install -Dm644 "$srcdir"/kdump.confd "$pkgdir"/etc/conf.d/kdump
}

doc() {
	default_doc
	amove "/usr/share/$pkgname"
}

sha512sums="
2436bbc5ced82e95e1c528cc63c6d71b5a386f34623f2f3cf6050019d21e6e81a15ddb5aa50cbec33b86228d2ba622f3ff37989b7cbeb6e66c94380380518f60  makedumpfile-1.7.6.tar.gz
e569e5b3616fcc708eeef25e9174c4b70f0008130faf300529c25e68a8d00d67f3f7293f280e58df9fc875a31ec5439375bc4f50e4f195547fa0565c3b823c2e  kdump.initd
2c5de66d56f59d4814064ba24b3f20d33c638cefb93b6258f082c96caa366c14be58efb4f0bccdcb9950dd4d6410683356c7e0fb5eadbb2793e2995c253bf95e  kdump.confd
"
